<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<html lang="zh-cn" xml:lang="zh-cn">
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="DC.Type" content="topic">
  <meta name="DC.Title" content="步骤5：注册MySQL/MariaDB数据库">
  <meta name="product" content="">
  <meta name="DC.Relation" scheme="URI" content="zh-cn_topic_0000001792343590.html">
  <meta name="prodname" content="">
  <meta name="version" content="">
  <meta name="brand" content="30-OceanProtect 备份一体机 1.5.0-1.6.0 帮助中心">
  <meta name="DC.Publisher" content="20240320">
  <meta name="DC.Format" content="XHTML">
  <meta name="DC.Identifier" content="ZH-CN_TOPIC_0000001839222573">
  <meta name="DC.Language" content="zh-cn">
  <link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
  <title>步骤5：注册MySQL/MariaDB数据库</title>
 </head>
 <body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px">
  <a name="ZH-CN_TOPIC_0000001839222573"></a><a name="ZH-CN_TOPIC_0000001839222573"></a>
  <h1 class="topictitle1">步骤5：注册MySQL/MariaDB数据库</h1>
  <div>
   <p>当MySQL/MariaDB数据库所在主机安装ProtectAgent后，<span>本产品</span>会自动发现MySQL/MariaDB数据库主机，您需要在管理界面上注册主机上的数据库，以对其进行保护或将其作为恢复目标。</p>
   <div class="section">
    <h4 class="sectiontitle">背景信息</h4>
    <p><span>本产品</span>支持备份<span>MySQL/MariaDB</span>数据库以及其他自定义数据库，不支持备份系统数据库<strong>information_schema</strong>、<strong>performance_schema</strong>、<strong>sys</strong>和<strong>mysql</strong>。因此不支持注册系统数据库。</p>
   </div>
   <div class="section">
    <h4 class="sectiontitle">前提条件</h4>
    <div class="p">
     注册MySQL/MariaDB集群实例前，请确保集群中每个节点已进行注册，否则未注册的节点无法备份数据，在恢复场景下，会造成恢复时间点的用户数据不一致。
     <div class="note">
      <img src="public_sys-resources/note_3.0-zh-cn.png"><span class="notetitle"> </span>
      <div class="notebody">
       <p>要求集群中所有节点的数据同步。</p>
      </div>
     </div>
    </div>
   </div>
   <div class="section">
    <h4 class="sectiontitle">注册MySQL/MariaDB单实例</h4>
    <ol>
     <li><span>选择<span class="uicontrol" id="ZH-CN_TOPIC_0000001839222573__zh-cn_topic_0000001839142377_uicontrol189688153618">“<span id="ZH-CN_TOPIC_0000001839222573__zh-cn_topic_0000001839142377_text148961988368">保护</span> &gt; 数据库 &gt; MySQL/MariaDB”</span>。</span></li>
     <li><span>选择<span class="uicontrol">“<span>实例</span>”</span>页签。</span></li>
     <li><span>单击<span class="uicontrol">“<span>注册</span>”</span>，注册<span>MySQL/MariaDB</span>。</span><p></p>
      <div class="note">
       <img src="public_sys-resources/note_3.0-zh-cn.png"><span class="notetitle"> </span>
       <div class="notebody">
        <p>MySQL集群环境下的所有实例不能用于单实例注册。</p>
       </div>
      </div> <p></p></li>
     <li><span><span class="uicontrol">“<span>类型</span>”</span>选择<span class="uicontrol">“<span>单实例</span>”</span>。</span></li>
     <li><span>配置数据库实例及其认证信息。</span><p></p><p>相关参数说明如<a href="#ZH-CN_TOPIC_0000001839222573__zh-cn_topic_0000001311214069_table241515964115">表1</a>所示。</p>
      <div class="tablenoborder">
       <a name="ZH-CN_TOPIC_0000001839222573__zh-cn_topic_0000001311214069_table241515964115"></a><a name="zh-cn_topic_0000001311214069_table241515964115"></a>
       <table cellpadding="4" cellspacing="0" summary="" id="ZH-CN_TOPIC_0000001839222573__zh-cn_topic_0000001311214069_table241515964115" frame="border" border="1" rules="all">
        <caption>
         <b>表1 </b>MySQL/MariaDB单实例注册信息
        </caption>
        <colgroup>
         <col style="width:25.629999999999995%">
         <col style="width:74.37%">
        </colgroup>
        <thead align="left">
         <tr>
          <th align="left" class="cellrowborder" valign="top" width="25.629999999999995%" id="mcps1.3.4.2.5.2.2.2.3.1.1"><p>参数</p></th>
          <th align="left" class="cellrowborder" valign="top" width="74.37%" id="mcps1.3.4.2.5.2.2.2.3.1.2"><p>说明</p></th>
         </tr>
        </thead>
        <tbody>
         <tr>
          <td class="cellrowborder" valign="top" width="25.629999999999995%" headers="mcps1.3.4.2.5.2.2.2.3.1.1 "><p><span>名称</span></p></td>
          <td class="cellrowborder" valign="top" width="74.37%" headers="mcps1.3.4.2.5.2.2.2.3.1.2 "><p>自定义实例名称。</p></td>
         </tr>
         <tr>
          <td class="cellrowborder" valign="top" width="25.629999999999995%" headers="mcps1.3.4.2.5.2.2.2.3.1.1 "><p><span>主机</span></p></td>
          <td class="cellrowborder" valign="top" width="74.37%" headers="mcps1.3.4.2.5.2.2.2.3.1.2 "><p>选择要注册的数据库主机。</p></td>
         </tr>
         <tr>
          <td class="cellrowborder" valign="top" width="25.629999999999995%" headers="mcps1.3.4.2.5.2.2.2.3.1.1 "><p>添加访问MySQL地址</p></td>
          <td class="cellrowborder" valign="top" width="74.37%" headers="mcps1.3.4.2.5.2.2.2.3.1.2 "><p>访问MySQL实例的IP地址。</p></td>
         </tr>
         <tr>
          <td class="cellrowborder" valign="top" width="25.629999999999995%" headers="mcps1.3.4.2.5.2.2.2.3.1.1 "><p><span>用户名</span></p></td>
          <td class="cellrowborder" valign="top" width="74.37%" headers="mcps1.3.4.2.5.2.2.2.3.1.2 "><p>请填写<a href="zh-cn_topic_0000001839142693.html">步骤1：开启MySQL/MariaDB数据库权限</a>创建的用户名。</p></td>
         </tr>
         <tr>
          <td class="cellrowborder" valign="top" width="25.629999999999995%" headers="mcps1.3.4.2.5.2.2.2.3.1.1 "><p><span>密码</span></p></td>
          <td class="cellrowborder" valign="top" width="74.37%" headers="mcps1.3.4.2.5.2.2.2.3.1.2 "><p>用户名密码。</p></td>
         </tr>
         <tr>
          <td class="cellrowborder" valign="top" width="25.629999999999995%" headers="mcps1.3.4.2.5.2.2.2.3.1.1 "><p><span>端口</span></p></td>
          <td class="cellrowborder" valign="top" width="74.37%" headers="mcps1.3.4.2.5.2.2.2.3.1.2 "><p>Linux环境下，界面显示为端口号，默认为3306。</p></td>
         </tr>
         <tr>
          <td class="cellrowborder" valign="top" width="25.629999999999995%" headers="mcps1.3.4.2.5.2.2.2.3.1.1 "><p>字符集</p>
           <div class="note">
            <span class="notetitle"> 说明： </span>
            <div class="notebody">
             <p>仅在1.6.0及后续版本展示该参数。</p>
            </div>
           </div></td>
          <td class="cellrowborder" valign="top" width="74.37%" headers="mcps1.3.4.2.5.2.2.2.3.1.2 "><p>数据库字符集。</p></td>
         </tr>
         <tr>
          <td class="cellrowborder" valign="top" width="25.629999999999995%" headers="mcps1.3.4.2.5.2.2.2.3.1.1 "><p>MySQL配置文件路径</p>
           <div class="note">
            <span class="notetitle"> 说明： </span>
            <div class="notebody">
             <p>仅在1.6.0及后续版本展示该参数。</p>
            </div>
           </div></td>
          <td class="cellrowborder" valign="top" width="74.37%" headers="mcps1.3.4.2.5.2.2.2.3.1.2 "><p>如果配置文件非默认路径，如/etc/my.cnf等，请填入MySQL配置文件路径。</p></td>
         </tr>
        </tbody>
       </table>
      </div> <p></p></li>
     <li><span>单击<span class="uicontrol">“确定”</span>。</span></li>
    </ol>
   </div>
   <div class="section">
    <h4 class="sectiontitle">注册MySQL/MariaDB集群实例</h4>
    <ol>
     <li><span>创建集群。</span><p></p>
      <ol type="a">
       <li>在MySQL/MariaDB页面选择<span class="uicontrol">“<span>集群</span>”</span>页签。</li>
       <li>单击<span class="uicontrol">“<span>注册</span>”</span>。</li>
       <li>在<span class="uicontrol">“<span>注册</span>”</span>页面，自定义集群名称并选择类型和集群节点。
        <div class="p">
         相关参数说明如<a href="#ZH-CN_TOPIC_0000001839222573__table8422135145120">表2</a>。 
         <div class="tablenoborder">
          <a name="ZH-CN_TOPIC_0000001839222573__table8422135145120"></a><a name="table8422135145120"></a>
          <table cellpadding="4" cellspacing="0" summary="" id="ZH-CN_TOPIC_0000001839222573__table8422135145120" frame="border" border="1" rules="all">
           <caption>
            <b>表2 </b>注册集群参数说明
           </caption>
           <colgroup>
            <col style="width:17.18%">
            <col style="width:82.82000000000001%">
           </colgroup>
           <thead align="left">
            <tr>
             <th align="left" class="cellrowborder" valign="top" width="17.18%" id="mcps1.3.5.2.1.2.1.3.2.2.2.3.1.1"><p>参数</p></th>
             <th align="left" class="cellrowborder" valign="top" width="82.82000000000001%" id="mcps1.3.5.2.1.2.1.3.2.2.2.3.1.2"><p>说明</p></th>
            </tr>
           </thead>
           <tbody>
            <tr>
             <td class="cellrowborder" valign="top" width="17.18%" headers="mcps1.3.5.2.1.2.1.3.2.2.2.3.1.1 "><p><span>名称</span></p></td>
             <td class="cellrowborder" valign="top" width="82.82000000000001%" headers="mcps1.3.5.2.1.2.1.3.2.2.2.3.1.2 "><p>自定义集群名称。</p></td>
            </tr>
            <tr>
             <td class="cellrowborder" valign="top" width="17.18%" headers="mcps1.3.5.2.1.2.1.3.2.2.2.3.1.1 "><p><span>类型</span></p></td>
             <td class="cellrowborder" valign="top" width="82.82000000000001%" headers="mcps1.3.5.2.1.2.1.3.2.2.2.3.1.2 "><p>集群类型可选择主备复制和<span style="color:#282B33;">PXC(Percona XtraDB Cluster)</span>类型。</p>
              <ul>
               <li>若选择<span class="uicontrol">“<span>主备复制</span>”</span>类型，则需要包含MySQL/MariaDB主实例所在节点。</li>
               <li>若选择<span class="uicontrol" style="color:#282B33;">“PXC(Percona XtraDB Cluster)”</span>类型，则需要包含MySQL/MariaDB集群实例所在节点。</li>
              </ul></td>
            </tr>
            <tr>
             <td class="cellrowborder" valign="top" width="17.18%" headers="mcps1.3.5.2.1.2.1.3.2.2.2.3.1.1 "><p><span>集群节点</span></p></td>
             <td class="cellrowborder" valign="top" width="82.82000000000001%" headers="mcps1.3.5.2.1.2.1.3.2.2.2.3.1.2 "><p>MySQL/MariaDB实例所在的主机。</p></td>
            </tr>
           </tbody>
          </table>
         </div>
         <div class="note">
          <img src="public_sys-resources/note_3.0-zh-cn.png"><span class="notetitle"> </span>
          <div class="notebody">
           <ul>
            <li>所选择的主机必须来源于同一集群。</li>
            <li>当数据库集群类型为主备集群时，在 /etc/my.cnf配置文件中，如果有relay-log配置项，请设置relay_log_recovery取值为on与之配合使用（避免恢复失败）。</li>
           </ul>
          </div>
         </div>
        </div></li>
       <li>单击<span class="uicontrol">“<span>确定</span>”</span>。</li>
      </ol> <p></p></li>
     <li><span>注册集群实例下的数据库。</span><p></p>
      <ol type="a">
       <li>在MySQL/MariaDB页面选择<span class="uicontrol">“<span>实例</span>”</span>页签。</li>
       <li>单击<span class="uicontrol">“<span>注册</span>”</span>。</li>
       <li><span class="uicontrol">“<span>类型</span>”</span>选择<span class="uicontrol">“<span>集群实例</span>”</span>。</li>
       <li>输入实例名，选择集群。</li>
       <li>单击“添加”，在弹出的添加对话框中添加集群实例下的所有节点。<p>相关参数说明如<a href="#ZH-CN_TOPIC_0000001839222573__table1412426182113">表3</a>所示。</p>
        <div class="tablenoborder">
         <a name="ZH-CN_TOPIC_0000001839222573__table1412426182113"></a><a name="table1412426182113"></a>
         <table cellpadding="4" cellspacing="0" summary="" id="ZH-CN_TOPIC_0000001839222573__table1412426182113" frame="border" border="1" rules="all">
          <caption>
           <b>表3 </b>集群实例的节点信息
          </caption>
          <colgroup>
           <col style="width:28.64%">
           <col style="width:71.36%">
          </colgroup>
          <thead align="left">
           <tr>
            <th align="left" class="cellrowborder" valign="top" width="28.64%" id="mcps1.3.5.2.2.2.1.5.2.2.3.1.1"><p>参数</p></th>
            <th align="left" class="cellrowborder" valign="top" width="71.36%" id="mcps1.3.5.2.2.2.1.5.2.2.3.1.2"><p>说明</p></th>
           </tr>
          </thead>
          <tbody>
           <tr>
            <td class="cellrowborder" valign="top" width="28.64%" headers="mcps1.3.5.2.2.2.1.5.2.2.3.1.1 "><p><span>主机</span></p></td>
            <td class="cellrowborder" valign="top" width="71.36%" headers="mcps1.3.5.2.2.2.1.5.2.2.3.1.2 "><p>选择集群下的主机节点。</p></td>
           </tr>
           <tr>
            <td class="cellrowborder" valign="top" width="28.64%" headers="mcps1.3.5.2.2.2.1.5.2.2.3.1.1 "><p>eAppMySQL地址</p></td>
            <td class="cellrowborder" valign="top" width="71.36%" headers="mcps1.3.5.2.2.2.1.5.2.2.3.1.2 "><p>访问eAppMySQL服务IP地址。</p></td>
           </tr>
           <tr>
            <td class="cellrowborder" valign="top" width="28.64%" headers="mcps1.3.5.2.2.2.1.5.2.2.3.1.1 "><p><span>端口</span></p></td>
            <td class="cellrowborder" valign="top" width="71.36%" headers="mcps1.3.5.2.2.2.1.5.2.2.3.1.2 "><p>Linux环境下，界面显示为端口号，默认为3306。</p></td>
           </tr>
           <tr>
            <td class="cellrowborder" valign="top" width="28.64%" headers="mcps1.3.5.2.2.2.1.5.2.2.3.1.1 "><p><span>用户名</span></p></td>
            <td class="cellrowborder" valign="top" width="71.36%" headers="mcps1.3.5.2.2.2.1.5.2.2.3.1.2 "><p>数据库用户名。</p></td>
           </tr>
           <tr>
            <td class="cellrowborder" valign="top" width="28.64%" headers="mcps1.3.5.2.2.2.1.5.2.2.3.1.1 "><p><span>密码</span></p></td>
            <td class="cellrowborder" valign="top" width="71.36%" headers="mcps1.3.5.2.2.2.1.5.2.2.3.1.2 "><p>数据库密码。</p></td>
           </tr>
           <tr>
            <td class="cellrowborder" valign="top" width="28.64%" headers="mcps1.3.5.2.2.2.1.5.2.2.3.1.1 "><p>字符集</p>
             <div class="note">
              <span class="notetitle"> 说明： </span>
              <div class="notebody">
               <p>仅在1.6.0及后续版本展示该参数。</p>
              </div>
             </div></td>
            <td class="cellrowborder" valign="top" width="71.36%" headers="mcps1.3.5.2.2.2.1.5.2.2.3.1.2 "><p>数据库字符集。</p></td>
           </tr>
           <tr>
            <td class="cellrowborder" valign="top" width="28.64%" headers="mcps1.3.5.2.2.2.1.5.2.2.3.1.1 "><p>MySQL配置文件路径</p>
             <div class="note">
              <span class="notetitle"> 说明： </span>
              <div class="notebody">
               <p>仅在1.6.0及后续版本展示该参数。</p>
              </div>
             </div></td>
            <td class="cellrowborder" valign="top" width="71.36%" headers="mcps1.3.5.2.2.2.1.5.2.2.3.1.2 "><p>如果配置文件非默认路径，如/etc/my.cnf等，请填入MySQL配置文件路径。</p></td>
           </tr>
          </tbody>
         </table>
        </div></li>
       <li>单击<span class="uicontrol">“<span>确定</span>”</span>。</li>
      </ol> <p></p></li>
    </ol>
   </div>
  </div>
  <div>
   <div class="familylinks">
    <div class="parentlink">
     <strong>父主题：</strong> <a href="zh-cn_topic_0000001792343590.html">备份MySQL/MariaDB数据库</a>
    </div>
   </div>
  </div>
 </body>
</html>